#include	<stdio.h>
#include	<stdlib.h>
#include	<stdint.h>
#include	<unistd.h>
#include	<string.h>
#include	<time.h>
#include	<wiringPi.h>
#include	<lcd.h>
#include	<sys/wait.h>
int main(int argc, char* argv[])
{
	
	int lcdHandle;
        char line1[16]="Hi";
        char line2[16]="IT";
	//printf	("Raspberry Pi LCD test\n");
	//printf	("=====================\n");
  	wiringPiSetup () ;
	lcdHandle=lcdInit(2,16,4,11,10,0,1,2,3,0,0,0,0);
	//sleep(1);
        	
	//lcdClear(lcdHandle);
        if (lcdHandle < 0)
        {
            fprintf (stderr," lcdInit failed\n") ;
            exit(-1) ;
        }
       if (argc>1) {
        snprintf(line1,"%s",argv[1],16);
        snprintf(line2,"%s",argv[2],16);
       }
	lcdClear(lcdHandle);
	lcdPosition(lcdHandle,0,0);
		
	lcdPuts(lcdHandle,line1);
	lcdPosition(lcdHandle,0,1);
	lcdPuts(lcdHandle,line2);
			
       

 	
	return	0;
}
